package com.example.consumptionrecords.entity.enums;

/**
 * SunJingxuan
 * 2022 \ 08 \ 01
 */

public enum GlobalConstants {

	// 全局
	ERROR(-1, "服务器摸鱼去了,先给您做条红烧鱼吧"),
	SUCCESS(200, "成功"),

	// 用户
	USER_NOT_EXIST(14004, "未找到此用户"),
	USER_PASSWORD_ERR(15000, "密码错误"),
	USER_GET_AUTH_CODE(15001, "获取验证码失败"),
	USER_AUTH_CODE_WRONG(15002, "验证码错误"),
	USER_AUTH_CODE_ERR(15003, "验证码校验异常"),
	USER_LOGIN_ERR(15004, "登陆异常"),
	USER_PHONE_EXISTS_ERR(15005, "当前手机号已注册，请更换"),
	USER_AUTH_CODE_TIMEOUT_ERR(15006, "未获取验证码或已过期"),

	//redis
	REDIS_CONNECTION_ERR(25000, "redis连接异常"),
	REDIS_SET_ERR(25001, "redis存储出错"),
	REDIS_SET_TIME_OUT_ERR(25002, "redis设置超时时间异常"),
	REDIS_GET_TIME_OUT_ERR(25003, "redis获取超时时间异常"),
	REDIS_GET_VALUE_ERR(25004, "redis获取值异常"),
	REDIS_DEL_VALUE_ERR(25005, "redis删除值异常"),
	REDIS_EXISTS_ERR(25006, "redis查询值是否存在异常"),
	REDIS_UPDATE_VALUE_ERR(25007, "redis更新值异常"),

	// ip地址
	IP_ADDRESS_GET_ERR(35000, "ip地址获取异常"),
	MAC_ADDRESS_GET_ERR(35001, "MAC地址获取异常"),

	// websocket
	WEB_SOCKET_ERR(45000, "通讯异常"),

	// 发消息
	SEND_MESSAGE_ERR(55000, "发送失败"),

	// token
	TOKEN_NOT_LOGIN_ERR(65000, "请登录后再操作"),
	TOKEN_INVALID_ERR(65001, "无效token"),
	TOKEN_EXPIRE_ERR(65002, "登录已过期"),

	// 百度千帆大模型
	QIANFAN_GET_ACCESS_TOKEN_HTTP_ERR(75000, "获取access_token的请求异常"),
	QIANFAN_GET_ACCESS_TOKEN_ERR(75001, "获取access_token异常"),
	QIANFAN_TALK_HTTP_ERR(75002, "千帆对话请求异常"),
	QIANFAN_TALK_ERR(75003, "千帆对话异常"),

	// 阿里灵积大模型——通义万相（文生图）
	DASH_SCOPE_TEXT_TO_IMG_NO_API_KEY_ERR(85000, "生成图片服务罢工"),
	DASH_SCOPE_TEXT_TO_IMG_API_ERR(85001, "生成图片失败,请重试"),
	DASH_SCOPE_TEXT_TO_IMG_ALL_TASK_API_ERR(85002, "获取所有文生图任务失败,请重试"),
	DASH_SCOPE_TEXT_TO_IMG_TASK_API_ERR(85003, "获取文生图任务失败,请重试");

	private final Integer code;
	private final String message;

	GlobalConstants(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	public Integer getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}
}
